Worker Progress Refactoring - #46
Conversation
|
/opencode /review pr |
|
Here's my review of the PR: SummaryClean refactoring — migrates all What's Good
Issues1. Log noise on every normal run (both jobs)
This adds unnecessary noise to production logs. Fix by keeping // Option A: use NORMAL.value as default (silent fallback)
val runModeInput = inputData.getInt(DATA_RUN_MODE, RunMode.NORMAL.value)
// Option B: don't log when it's just the default sentinel
if (result == null && runModeInput != -1) {
logger.w { "Invalid RunMode $runModeInput, falling back to ${RunMode.NORMAL}" }
}2. Magic sentinel in
fun Progress.Companion.fromWorkData(data: Data): Progress? {
if (!data.keyValueMap.containsKey(KEY_CURRENT) && !data.keyValueMap.containsKey(KEY_TOTAL)) {
return null
}
return Progress(
current = data.getInt(KEY_CURRENT, 0),
total = data.getInt(KEY_TOTAL, -1),
)
}This avoids sentinel values entirely by checking key presence. Minor Suggestions
VerdictApprove after fixing issue #1. The rest is solid. |
|
/opencode Follow up the new commits |
|
Three follow-up commits address the review's two main issues: Issue #1 — Log noise ( val runModeInput = inputData.getInt(DATA_RUN_MODE, -1) // should be 0 like R30UpdateJobIssue #2 — Magic sentinel One remaining nit: |


Pair<Int, Int>?toProgressintroduced in OCR Queue Refactoring #45.